<?php

require_once 'cms/contact/om/om/BaseContact.php';


/**
 * Skeleton subclass for representing a row from the 'contact' table.
 *
 * 
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package cms.contact.om
 */	
class Contact extends BaseContact {
	
	/**
     * Add to search index
     */
    function addToIndex($indexPath, $lang) {
        
        // Update Lucene index
        require_once("util/Search.php");

        $search = new Search($indexPath);
        $search->addDocument(
            "contact_".$this->getContactId(),               // UID      ( indexed )
            $this->getFirstName()." ".$this->getSurname(),  // Title    ( tokenized & indexed )
			$this->getRole()." ".$this->getOffice(),        // Summary  ( tokenized )
            $this->getRole()." ".$this->getOffice(),        // Body     ( tokenized )
            $lang,                                          // Language ( indexed )
            "contact/edit"                                  // URL      ( stored )
        );
        $search->optimize();
        
    }

} // Contact
